package z;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Notebook {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("note.txt");
        Scanner scan=new Scanner(System.in);
        String line;
        while(true){
            System.out.println("请输入字符串:u");
             line = scan.nextLine();
             if("exit".equals(line))
                 break;
            byte[] bytes = line.getBytes(StandardCharsets.UTF_8);
            fos.write(bytes);
        }
        System.out.println("完成");
        fos.close();
    }
}
